package chixing.day12.generic;

public class LocationTest {
    public static void main(String[] args) {
        Location<Integer,Float> location1 = new Location<>();
        location1.setX(10);//x的类型只能是Integer类型==保证了数据类型的安全性
        location1.setY(10.0f);//y的类型只能是float类型==保证了数据类型的安全性

        Location<String,Integer> location2 = new Location<>("33度",18);
        String x = location2.getX();
        Integer y = location2.getY();

    }
}
